<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/page/share/taglib.jsp"%>
<%
	response.setHeader("Cache-Control", "no-store"); //HTTP1.1
	response.setHeader("Pragma", "no-cache"); //HTTP1.0
	response.setDateHeader("Expires", 0);
	String root = request.getContextPath();
%>
<form name="queryForm" id="queryForm"
	action="<%=request.getContextPath()%>/batchCtl/batchMngt!listStep2Run.do"
	method="post">
	<input type="hidden" name="curPageNo" id="currentPgNoHid"
		value="<s:property value="curPageNo" />" />
</form>

<div id="queryListDiv">
	<div>
		批次日期：<input type="text" id="run_batchTime" name="run_batchTime" value="" size="10"
			onfocus="WdatePicker({dateFmt:'yyyyMMdd'})" maxlength="8">
	</div>
	<h2 class="u-title">步骤信息列表：</h2>
	<table class="datashow" style="width: 95%; table-layout: fixed;"
		cellpadding="0" cellspacing="0">
		<thead>
			<tr class="alt">
				<th width="10%" class="table_head">批次编号</th>
				<th width="10%" class="table_head">任务编号</th>
				<th width="10%" class="table_head">步骤编号</th>
				<th width="10%" class="table_head">步骤名称</th>
				<th width="10%" class="table_head">运行周期</th>
				<th width="10%" class="table_head">执行控制位</th>
				<th width="10%" class="table_head">步骤操作</th>
			</tr>
		</thead>
		<tbody>
			<s:if test="stepPageInfo.records.size > 0">
				<s:iterator value="stepPageInfo.records" var="stepInfo"
					status="status">
					<tr>
						<td><s:property value="#stepInfo.batchNo" /></td>
						<td><s:property value="#stepInfo.jobNo" /></td>
						<td><s:property value="#stepInfo.stepNo" /></td>
						<td><s:property value="#stepInfo.stepName" /></td>
						<td><s:property value="#stepInfo.chStepRunPeriod" /></td>
						<td><s:property value="#stepInfo.chStepCtrlFlgs" /></td>
						<td><a id="btn" href="#"
							class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
							onclick="runJob('<s:property value="#stepInfo.batchNo" />','<s:property value="#stepInfo.jobNo" />','<s:property value="#stepInfo.stepNo" />');">
								<span class="ui-button-text">拉起单个步骤</span>
						</a></td>
					</tr>
				</s:iterator>
			</s:if>
			<s:else>
				<tr>
					<td><span style="color: blue">暂无记录！</span></td>
				</tr>
			</s:else>
		</tbody>
	</table>

	<table class="datashow" style="width: 95%; table-layout: fixed;"
		cellpadding="0" cellspacing="0">
		<tr>
			<td width="100%" align="center"><SPAN class="pagebanner">
					共<label id="allSize">${stepPageInfo.totalrecord}</label>条记录&nbsp;&nbsp;&nbsp;
					<label id="currentPage">${stepPageInfo.currentpage}</label>/<label
					id="allPages">${stepPageInfo.totalpage}</label>页 &nbsp;&nbsp;&nbsp;
					<input type="button" value="转至" onclick="myGotoPage(); " /> <input
					type="text" style="width: 45px; text-align: center;"
					id="changePageTo" name="changePageTo"
					value="${stepPageInfo.currentpage }"></input>页 &nbsp;&nbsp;&nbsp; <a
					href="#" onclick="myPrePage();"> <IMG
						src="<%=root%>/resources/images/btn_arrowback.jpg"></a>&nbsp;
					<a href="#" onclick="myNextPage();"> <IMG
						src="<%=root%>/resources/images/btn_arrowforward.jpg"></a>
			</SPAN></td>
		</tr>
	</table>


	
</div>
<div id="result"></div>
<script type="text/javascript">
	function runJob(batchNOVal, jobNoVal, stepNoVal) {
		var settle_dt = $('#run_batchTime').val();
		if (settle_dt == null || settle_dt == '') {
			alert("请录入批次日期");
			return;
		}
	    var _ctx = "<%=root%>";
		var url = _ctx + "/batchCtl/batchRun!runStep.do";
		$("#result").load(url, {
			batchNo : batchNOVal,
			jobNo : jobNoVal,
			stepNo : stepNoVal,
			batchTime : settle_dt
		}, function() {
			alert("执行完毕");
		});
		return url;
	}
</script>